package com.freddy.sqlite;

import android.app.Application;

import com.freddy.sqlite.db.DataBaseHelper;

/**
 * Created by Freddy on 2015/10/9.
 * chenshichao@outlook.com
 */
public class FreddyChenApplication extends Application {

    private static FreddyChenApplication INSTANCE;
    /**
     * 程序启动入口
     */
    @Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;

        DataBaseHelper.getInstance().initDatabase();
    }

    public static FreddyChenApplication getInstance() {
        if(null == INSTANCE) {
            throw new IllegalStateException("not init");
        }

        return INSTANCE;
    }
}
